<include file="Inc/html_header" />
<div class="mtop10">
    <table class="table table-bordered table-hover">
        <thead>
        <tr>
            <th colspan="2"><i class="icon icon-th"></i> TP缓存</th>
        </tr>
        </thead>
        <tbody>
        <tr>
            <td width="230">清理[common~runtime.php]：</td>
            <td><a href="javascript:;" class="btn btn-sm btn-warning" onclick="clearCommonRuntimePHP()"><i class="icon icon-trash"></i> 提交</a></td>
        </tr>
        <tr>
            <td>清理[Runtime/Temp]：</td>
            <td><a href="javascript:;" class="btn btn-sm btn-warning" onclick="clearRuntimeTemp()"><i class="icon icon-trash"></i> 提交</a></td>
        </tr>
        <tr>
            <td>清理[Runtime/Data]：</td>
            <td><a href="javascript:;" class="btn btn-sm btn-warning" onclick="clearRuntimeData()"><i class="icon icon-trash"></i> 提交</a></td>
        </tr>
        <tr>
            <td>清理[Public/js/common/init.js]：</td>
            <td><a href="javascript:;" class="btn btn-sm btn-warning" onclick="clearPublicInit()"><i class="icon icon-trash"></i> 提交</a></td>
        </tr>
        <tr>
            <td>清理模版缓存：</td>
            <td class="mySelect">
                <select name="module" id="module">
                    <option value="-1">- - 请选择 - -</option>
                    <?php foreach($module as $val){ ?>
                        <option value="{$val}">{$val}</option>
                    <?php } ?>
                </select>
                <a href='javascript:;' class="btn btn-sm btn-warning" onclick ="clearRuntimeCache()"><i class="icon icon-trash"></i>提交</a>
            </td>
        </tr>
        </tbody>
    </table>
</div>
<script type="text/javascript">
    function clearCommonRuntimePHP()
    {
        if( ! confirm('确认？')){ return false; }
        $.ajax({
            url:'/framework/clear_common_runtime',
            dataType:'json',
            type:'post',
            success:function(msg){
                if(msg.st == 'n'){
                    alert(msg.note);
                }else{
                    alert('操作成功');
                }
            },
            error:function(){
                alert('参数错误');
            }
        });
    }

    function clearRuntimeTemp()
    {
        if( ! confirm('确认？')){ return false; }
        $.ajax({
            url:'/framework/clear_runtime_temp',
            dataType:'json',
            type:'post',
            success:function(msg){
                if(msg.st == 'n'){
                    alert(msg.note);
                }else{
                    alert('操作成功');
                }
            },
            error:function(){
                alert('参数错误');
            }
        });
    }

    function clearRuntimeData()
    {
        if( ! confirm('确认？')){ return false; }
        $.ajax({
            url:'/framework/clear_runtime_data',
            dataType:'json',
            type:'post',
            success:function(msg){
                if(msg.st == 'n'){
                    alert(msg.note);
                }else{
                    alert('操作成功');
                }
            },
            error:function(){
                alert('参数错误');
            }
        });
    }

    function clearPublicInit()
    {
        if( ! confirm('确认?')){ return false; }
        $.ajax({
            url:'/framework/clear_public_init',
            dataType:'json',
            type:'post',
            success:function(msg){
                if(msg.note == 'n'){
                }else{
                    alert('操作成功');
                }
            },
            error:function(){
                alert('参数错误');
            }
        });
    }

    function clearRuntimeCache()
    {
        if(! confirm('确认？')){ return false; }
        var md = $('#module').val();
        //console.log($module);
        $.ajax({
            url:'/framework/clear_runtime_cache',
            data:{'module':md},
            dataType:'json',
            type:'post',
            success:function(msg){
                if(msg.st == 'n'){
                    alert(msg.note);
                }else{
                    alert('操作成功');
                }
            }
        });
    }
</script>
<include file="Inc/html_footer" />